home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / lib / ubiquity / plugins / ubi-intro.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-10-28  |  2KB  |  78 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import os
  5. from ubiquity.plugin import *
  6. NAME = 'intro'
  7. AFTER = None
  8. WEIGHT = 100
  9.  
  10. def get_intro():
  11.     '''Get some introductory text, if available.'''
  12.     if 'UBIQUITY_OEM_USER_CONFIG' in os.environ or 'UBIQUITY_AUTOMATIC' in os.environ:
  13.         return None
  14.     intro = None
  15.     introFiles = [
  16.         '/usr/share/ubiquity/intro.txt',
  17.         '/usr/share/ubiquity/kubuntu-netbook-intro.txt']
  18.     for file in introFiles:
  19.         if os.path.isfile(file):
  20.             intro = file
  21.             break
  22.             continue
  23.         'UBIQUITY_AUTOMATIC' in os.environ
  24.     
  25.     if intro is None:
  26.         return None
  27.     intro_file = open(intro)
  28.     text = intro_file.read()
  29.     intro_file.close()
  30.     return text
  31.  
  32.  
  33. class PageGtk(PluginUI):
  34.     
  35.     def __init__(self, *args, **kwargs):
  36.         text = get_intro()
  37.         if text:
  38.             
  39.             try:
  40.                 import gtk as gtk
  41.                 builder = gtk.Builder()
  42.                 builder.add_from_file('/usr/share/ubiquity/gtk/stepIntro.ui')
  43.                 builder.get_object('intro_label').set_markup(text.rstrip('\n'))
  44.                 self.plugin_widgets = builder.get_object('stepWelcome')
  45.             except Exception:
  46.                 e = None
  47.                 self.debug('Could not create intro page: %s', e)
  48.             except:
  49.                 None<EXCEPTION MATCH>Exception
  50.             
  51.  
  52.         None<EXCEPTION MATCH>Exception
  53.  
  54.  
  55.  
  56. class PageKde(PluginUI):
  57.     plugin_breadcrumb = None
  58.     
  59.     def __init__(self, *args, **kwargs):
  60.         text = get_intro()
  61.         if text:
  62.             
  63.             try:
  64.                 uic = uic
  65.                 import PyQt4
  66.                 self.plugin_widgets = uic.loadUi('/usr/share/ubiquity/qt/stepIntro.ui')
  67.                 self.plugin_widgets.introLabel.setText(text.replace('\n', '<br>'))
  68.             except Exception:
  69.                 e = None
  70.                 self.debug('Could not create intro page: %s', e)
  71.             except:
  72.                 None<EXCEPTION MATCH>Exception
  73.             
  74.  
  75.         None<EXCEPTION MATCH>Exception
  76.  
  77.  
  78.